#pragma once

#include "lg.h"

#include "lg2d_def.h"
#include "lg2d_conf.h"


typedef struct LG2DScene LG2DScene;
typedef struct LG2DObj LG2DObj;
typedef struct LG2DShape LG2DShape;


LG2D_API LG2DScene*
lg2dNewScene(unsigned width, unsigned height);
LG2D_API void
lg2dDrawScene(LG2DScene* scene);
LG2D_API LGCanvas*
lg2dGetSceneCanvas(LG2DScene* scene);
LG2D_API LG2DObj*
lg2dGetSceneRoot(LG2DScene* scene);
LG2D_API void
lg2dResizeScene(LG2DScene* scene, unsigned width, unsigned height);

LG2D_API void*
lg2dNewObj();
LG2D_API void*
lg2dNewExtendObj(size_t size, LGRefFree free);
LG2D_API void
lg2dAddChild(void* parent, void* child);
LG2D_API void
lg2dRemoveChild(void* parent, void* child);
LG2D_API void
lg2dSetPosition(void* obj, LGFloat x, LGFloat y);
LG2D_API void
lg2dSetRotate(void* obj, LGFloat rotate);
LG2D_API void
lg2dSetScale(void* obj, LGFloat x, LGFloat y);

LG2D_API LG2DShape*
lg2dNewShape();
LG2D_API void
lg2dClearShape(LG2DShape* shape);
LG2D_API void
lg2dShapeColor(LG2DShape* shape, LGVector* color);
LG2D_API void
lg2dShapeRect(LG2DShape* shape, LGFloat rect[4]);
